<script setup lang="ts">
import AddEnterprise from '@/pages/flagship-store/component/addEnterprise.vue'
import BuildMana from '@/pages/flagship-store/component/buildMana.vue'
import CoverImg from '@/pages/flagship-store/component/coverImg.vue'
import StoreForm from '@/pages/flagship-store/component/storeForm.vue'
import StoreStyle from '@/pages/flagship-store/component/storeStyle.vue'

// const router = useRouter()
const { go } = useRouter()
const addStoreForm = ref<any>()
const activeName = ref<string>('first')
// 返回店铺管理
function rebackChange() {
    // router.push('/content-center/flagship-store/flagshipStore/management')
    go(-1)
}
// 修改店铺提交
function popsubmit() {
    // 调用表单校验
    addStoreForm.value.validatechange('1')
}
</script>

<template>
    <ElCard class="mb-20"
            shadow="never"
    >
        <el-tabs v-model="activeName"
                 class="demo-tabs"
        >
            <el-tab-pane label="编辑店铺"
                         name="first"
            >
                <template v-if="activeName === 'first'">
                    <StoreForm ref="addStoreForm" />

                    <div class="form-btn">
                        <el-button plain
                                   @click="rebackChange"
                        >
                            返回
                        </el-button>

                        <el-button type="primary"
                                   @click="popsubmit"
                        >
                            提交
                        </el-button>
                    </div>
                </template>
            </el-tab-pane>

            <!-- <el-tab-pane label="旗舰店样式管理"
                         name="second"
            >
                <StoreStyle v-if="activeName === 'second'" />
            </el-tab-pane> -->

            <el-tab-pane label="旗舰店楼盘管理"
                         name="third"
            >
                <BuildMana v-if="activeName === 'third'" />
            </el-tab-pane>

            <el-tab-pane label="品牌封面设置"
                         name="four"
            >
                <CoverImg v-if="activeName === 'four'" />
            </el-tab-pane>

            <!-- <el-tab-pane label="企业资讯管理"
                         name="five"
            >
                <AddEnterprise v-if="activeName === 'five'" />
            </el-tab-pane> -->
        </el-tabs>
    </ElCard>
</template>

<style lang="less" scoped></style>
